﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Web.Profile;

namespace WebSite.admin
{
    public partial class languages : System.Web.UI.UserControl
    {
      

        // Methods
        private void Bind()
        {
            if (SQLAccess.languages("0").IndexOf("1") != -1)
            {
                this.Radio1.Visible = false;
                this.Label1.Visible = false;
            }
            if (SQLAccess.languages("0").IndexOf("2") != -1)
            {
                this.Radio2.Visible = false;
                this.Label2.Visible = false;
            }
            if (SQLAccess.languages("0").IndexOf("3") != -1)
            {
                this.Radio3.Visible = false;
                this.Label3.Visible = false;
            }
            if (SQLAccess.languages("0").IndexOf("4") != -1)
            {
                this.Radio4.Visible = false;
                this.Label4.Visible = false;
            }
            if (base.Request.QueryString["lan"] == null)
            {
                if (SQLAccess.languagesa("0").IndexOf("1") != -1)
                {
                    this.Radio1.Checked = true;
                }
                else if (SQLAccess.languagesa("0").IndexOf("2") != -1)
                {
                    this.Radio2.Checked = true;
                }
                else if (SQLAccess.languagesa("0").IndexOf("3") != -1)
                {
                    this.Radio3.Checked = true;
                }
                else if (SQLAccess.languagesa("0").IndexOf("4") != -1)
                {
                    this.Radio4.Checked = true;
                }
            }
            else if (base.Request.QueryString["lan"].ToString() == "cn")
            {
                this.Radio1.Checked = true;
                if (!this.Radio1.Visible)
                {
                    this.Radio2.Checked = true;
                }
            }
            else if (base.Request.QueryString["lan"].ToString() == "en")
            {
                this.Radio3.Checked = true;
            }
            else if (base.Request.QueryString["lan"].ToString() == "other")
            {
                this.Radio4.Checked = true;
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                this.Bind();
            }
        }

    }
}